<?php 
    namespace Home\Model;
    use Think\Model;
    class GroupModel extends Model{
        //自动验证
        protected $_validate = array(
          array('groupname','require','部门名不能为空'), 
         
        );
    }